package com.mdjukebox.model.adminfacade.actions;

import java.sql.Connection;
import java.sql.SQLException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.mdjukebox.model.dao.CancionDAO;
import com.util.exceptions.InternalErrorException;
import com.util.exceptions.ModelException;
import com.util.sql.TransactionalPlainAction;

public class TodasCancionesAction implements TransactionalPlainAction {

	private static Log log = LogFactory.getLog(TodasCancionesAction.class);
	
	public TodasCancionesAction() {
	}
	
	public Object execute(Connection connection) throws ModelException,
			InternalErrorException {
			
		try {
			
			CancionDAO dao = new CancionDAO();
			return dao.getCanciones(connection);
			
		} catch (SQLException e) {
			throw new InternalErrorException(e);
		}
		
	}
	
	
}
